using System;
using iopt.solvency.pillarone.client.desktop.Helpers;

namespace iopt.solvency.pillarone.client.desktop.ViewModels
{
    public class VMTool : BaseViewModel
    {
        private Object _View;
        public Object View
        {
            get
            {
                return _View;
            }
            set
            {
                _View = value;
                OnPropertyChanged("View");
            }
        }

        public bool IsSelected
        {
            get
            {
                return false;
            }
            set
            {
                OnPropertyChanged("IsSelected");
            }
        }

        private string _Caption;
        public string Caption
        {
            get
            {
                return _Caption;
            }
            set
            {
                _Caption = value;
                OnPropertyChanged("Caption");
            }
        }

        public DelegateCommand ShowToolCommand
        {
            get { return new DelegateCommand(ShowToolExecute); }
        }
        private void ShowToolExecute(object parameter)
        {
            var vmmainwindow =App.Current.MainWindow.DataContext  as iopt.solvency.pillarone.client.desktop.ViewModels.MainWindowViewModel;

            vmmainwindow.Tools.Remove(this);

            vmmainwindow.Tools.Add(this);
        }
    }
}